class Insurer < ActiveRecord::Base
	after_create :gen_code
	has_many :customers

	def gen_code
	  code = rand(100000).to_s.rjust(6, "0")
  	  update_attributes(code: code)
	end
end
